<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var str="4789796099@qq.com";
			var atIndex=str.indexOf("@");
			alert(str.substring(0,atIndex));
		</script>
	</body>
</html>
